<template>
	<view class="content">
		<!-- <rich-text  :nodes="{{data}}"></rich-text> -->
		<!-- <rich-text :nodes="data"></rich-text> -->

		<view v-html="data" calss="content-view" v-if="isHetong"></view>
		<view v-else>暂无合同模版</view>
	</view>
</template>

<script>
	import parseHtml from "../../common/ht.js"
	export default {
		data() {
			return {
				id: "",
				data: "",
				isLoading: true,
				loadingText: '正在加载合同....',
				isHetong: true
			}
		},
		methods: {
			zlht() {
				let self = this;
				self._post('agreement.agreement/detail', {
					id: self.id
				}, function(res) {
					console.log("res", res.data);
					if (res.data.data == null) {
						uni.showToast({
							title: '暂无合同模版',
							icon: 'none'
						});
					} else {
						self.data = parseHtml(res.data.data.text);
					}
				});
			}


		},
		onLoad(data) {
			this.id = data.id
			this.zlht()
		}
	}
</script>

<style>
	.content {
		padding: 20rpx;
	}

	.content-view {
		width: 100%;
	}
</style>